import {baseURL, http} from "../plugin/axios.js";
import Qs from "qs";

export const getNewsAPI = (type)=>{
    return http.request({
        method:"GET",
        url:baseURL+'/resource/public/important_news',
        params:{
            length:8,
            type
        },
        paramsSerializer: function (params) {
            return Qs.stringify(params, {arrayFormat: 'brackets'})
        }
    })
}

export const getPost=(id)=>{
    return http.request({
        method:"get",
        url:baseURL+"/resource/public/post",
        params:{
            id
        },
        paramsSerializer: function (params) {
            return Qs.stringify(params, {arrayFormat: 'brackets'})
        }
    })
}
